Personal Command Line Programs Usage

Meow King October 22, 2023 Updated: October 22, 2023 #cli

Pacman

# show the associated package of a file
pacman -Qo convert # => imagemagick
# show all packages that has at least a file named convert
pacman -F convert

# show all associated executables
pkgfile -lb imagemagick # need to install extra/pkgfile
pacman -Ql imagemagick | grep /usr/bin # roughly do the job

# clean packages
pacman -Sc # only the old builds
pacman -Scc # all builds

Image Magic

Usage: https://imagemagick.org/Usage/ Reference: https://imagemagick.org/Usage/reference.html

script to make image into shaped and transparent: mktrans

# change one color of an image to transparent (if chaning background/border, use the `mktrans` script metioned above)
convert input.jpg input.png # convert to png first, since jpg doesn't support transparency
convert input.png -fuzz 2% -transparent white output.png
## use median filter to better smooth the image
mogrify -format png -median 2 -fuzz 5% -transparent white ico_*.jpg

# change colors of an image to transparent
convert input.jpg input.png # convert to png first, since jpg doesn't support transparency
convert input.png -fuzz 2% -transparent white output.png
## use median filter to better smooth the image
mogrify -format png -median 2 -fuzz 5% -transparent white ico_*.jpg

# trim border of a image (for transparent border. For white border, use -bordercolor white)
convert -fuzz 25% -trim -border 25 -bordercolor none +repage ./apple.png ./apple_t.png

Upload file to cloud

use rclone